package com.yuting.user.service;

import com.yuting.common.pojo.Token;
import com.yuting.user.dao.TokenDao;
import lagou.service.dubbo.api.RpcUserService;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;


@Service
public class RpcUserServiceImpl implements RpcUserService {


    @Autowired
    private TokenDao tokenDao;
    @Override
    public String userInfo(String token) {
        Token byTokenEquals = tokenDao.findByTokenEquals(token);
        if(byTokenEquals != null){
            return byTokenEquals.getEmail();
        }else{
            return "error";
        }
    }
}
